package cn.sdormitory.basedata.dao;

import cn.sdormitory.basedata.dto.DeviceWithClass;
import cn.sdormitory.basedata.dto.DeviceWithDor;
import cn.sdormitory.basedata.entity.BDevice;
import cn.sdormitory.basedata.entity.DorDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author: lx
 * @date: 2023/8/5 8:46
 * @description:
 */
@Mapper
@Component
public interface BDeviceDao extends BaseMapper<BDevice> {

    int findPageListCount(@Param("query") BDevice query);

    List<BDevice> findPageList(@Param("startNum") int startNum,
                                          @Param("pageSize") Integer pageSize,
                                          @Param("query") BDevice query);

    /**
     * 获取所有设备信息以及其班级id
     * @return
     */
    List<DeviceWithClass> getAllDeviceWithClassId();

    List<DeviceWithDor> getAllDeviceWithSd();

}
